<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<style>
		.active {
			color: red;
			font-size: 20px;
		}

		.Test1 {
			font-weight: bold;
		}

		.Test2 {
			background-color: green;
		}
	</style>
</head>

<body>
	<div id="app">
		<div v-bind:class="{active:isactive,Test1:isTest1,Test2:isTest2}">123214</div>
		<div v-bind:class="classObj">这是一段测试文本</div>
		<div v-bind:class="classArr">class使用数组绑定</div>

		<child :class="classArr"></child>
	</div>
	<script src="./js/vue.js"></script>
	<script>
		Vue.component('child', {
			template: `
			<div>
				<div>子组件的div</div>
			</div>`
		})
		var app = new Vue({
			el: '#app',
			data: {
				isactive: true,
				isTest1: true,
				isTest2: true,
				classArr: ['active', 'Test1'],
				classObj: {
					active: true,
					Test1: true,
					Test2: true,
				}
			},
			methods: {

			}
		})
	</script>
</body>

</html>